﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Models;
using BLL;

namespace WcfService1
{
    /// <summary>
    /// WebService1 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class WebService1 : System.Web.Services.WebService
    {
        BLL.Usertab_RoleBll userbll = new Usertab_RoleBll();
        BLL.quanXianBll quanbll = new quanXianBll();
        PeixunBLL peixunbll = new PeixunBLL();//培训BLL
        [WebMethod]
        /// <summary>
        /// 添加用户信息
        /// </summary>
        /// <param name="user">用户类</param>
        /// <returns></returns>
        public int AddUser(Models.Usertab_Role user)
        {
            return userbll.AddUser(user);
        }
        [WebMethod]
        /// <summary>
        /// 用户信息判断
        /// </summary>
        /// <param name="del"></param>
        /// <returns></returns>
        public List<Models.Usertab_Role> userShowpd(Models.Usertab_Role del)
        {
            return userbll.userShowpd(del);
        }
        [WebMethod]
        /// <summary>
        /// 用户信息查找
        /// </summary>
        /// <param name="del"></param>
        /// <returns></returns>
        public List<Models.Usertab_Role> idShow(int userid)
        {
            return userbll.idShow(userid);
        }
        [WebMethod]
        /// <summary>
        /// 用户信息分页
        /// </summary>
        /// <param name="del"></param>
        /// <returns></returns>
        public List<Models.Usertab_Role> userShow(out int zongCount, int pageIndex, int pageSize, string userName)
        {
            return userbll.userShow(out zongCount, pageIndex, pageSize, userName);
        }
        [WebMethod]
        /// <summary>
        /// 修改用户信息
        /// </summary>5
        /// <param name="user">用户类</param>
        /// <returns></returns>
        public int delUser(Models.Usertab_Role user)
        {
            return userbll.delUser(user);
        }
        [WebMethod]
        /// <summary>
        /// 冻结、解冻用户
        /// </summary>
        /// <param name="userdel"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        public int userDong(int userdel, int usershan, int userid)
        {
            return userbll.userDong(userdel, usershan, userid);
        }
        [WebMethod]
        /// <summary>
        /// 角色信息读取
        /// </summary>
        /// <returns></returns>
        public List<Models.Usertab_Role> showRole()
        {
            return userbll.showRole();
        }
        [WebMethod]
        /// <summary>
        /// 角色信息添加
        /// </summary>
        /// <returns></returns>
        public int addRole(string rolename)
        {
            return userbll.addRole(rolename);
        }
        [WebMethod]
        /// <summary>
        /// 角色信息删除
        /// </summary>
        /// <returns></returns>
        public int delRole(int roleid)
        {
            return userbll.delRole(roleid);
        }
        [WebMethod]
        /// <summary>
        /// 角色信息修改
        /// </summary>
        /// <returns></returns>
        public int updRole(int roleid, string rolename)
        {
            return userbll.updRole(roleid, rolename);
        }
        [WebMethod]
        /// <summary>
        /// 读取所有权限
        /// </summary>
        /// <returns></returns>
        public List<Models.quanXian> showQuan()
        {
            return quanbll.showQuan();
        }
        [WebMethod]
        /// <summary>
        /// 权限查询
        /// </summary>
        /// <returns></returns>
        public List<Models.quanXian> chaQuan(int roleid)
        {
            return quanbll.chaQuan(roleid);
        }
        [WebMethod]
        /// <summary>
        /// 批量删除权限
        /// </summary>
        /// <param name="roleid"></param>
        /// <returns></returns>
        public int delQuan(string roleid)
        {
            return quanbll.delQuan(roleid);
        }
        [WebMethod]
        /// <summary>
        /// 批量添加权限
        /// </summary>
        /// <param name="roleid"></param>
        /// <param name="qxid"></param>
        /// <returns></returns>
        public int addQuan(int roleid, string qxid)
        {
            return quanbll.addQuan(roleid, qxid);
        }
        [WebMethod]
        public List<Staff> Ryxinxi()
        {
            return new BLL.RenyuanBLL().YGxinxi();
        }
        [WebMethod]
        /// <summary>
        /// 显示机构信息
        /// </summary>
        /// <returns></returns>
        public List<Models.Jigou> showJigou()
        {
            return new BLL.JiGouBll().showJigou();
        }
        [WebMethod]
        /// <summary>
        /// 修改机构信息
        /// </summary>
        /// <param name="del"></param>
        /// <returns></returns>
        public int updJigou(Models.Jigou del)
        {
            return new BLL.JiGouBll().updJigou(del);
        }
        [WebMethod]
        /// <summary>
        /// 培训记录显示
        /// </summary>
        /// <returns></returns>
        public List<train_tbModel> peixunshow()
        {

            return peixunbll.peixunshow();
        }
        [WebMethod]
        /// <summary>
        /// 培训类型显示
        /// </summary>
        /// <returns></returns>
        public List<traintype_tbModel> traintypeshow()
        {
            return peixunbll.traintypeshow();
        }
        [WebMethod]
        /// <summary>
        /// 培训人员表显示
        /// </summary>
        /// <returns></returns>
        public List<traineeModel> traineeshow()
        {
            return peixunbll.traineeshow();

        }
        [WebMethod]
        /// <summary>
        /// 培训人员表的删除
        /// </summary>
        /// <param name="trainee_id"></param>
        /// <returns></returns>
        public int traineeDEL(int trainee_id)
        {
            return peixunbll.traineeDEL(trainee_id);
        }
        [WebMethod]
        /// <summary>
        /// 培训人员的添加
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public int traineeADD(traineeModel t)
        {
            return peixunbll.traineeADD(t);
        }
        [WebMethod]
        /// <summary>
        /// 培训人员表反填
        /// </summary>
        /// <returns></returns>
        public List<traineeModel> traineeft(int trainee_id)
        {
            return peixunbll.traineeft(trainee_id);
        }
        [WebMethod]
        /// <summary>
        /// 培训人员的修改
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public int traineeUPT(traineeModel t)
        {
            return peixunbll.traineeUPT(t);
        }
        [WebMethod]
        /// <summary>
        /// 员工证书显示
        /// </summary>
        /// <returns></returns>
        public List<certificate_tbModel> certificate_tb()
        {
            return peixunbll.certificate_tb();
        }
        [WebMethod]
        /// <summary>
        /// 培训类型的维护添加
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        public int traintypeadd(traintype_tbModel t)
        {
            return peixunbll.traintypeadd(t);
        }
        [WebMethod]
        /// <summary>
        /// 培训类型的反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public traintype_tbModel traintypeft(int id)
        {
            return peixunbll.traintypeft(id);
        }
        [WebMethod]
        /// <summary>
        /// 培训类型删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int traintypedel(int id)
        {
            return peixunbll.traintypedel(id);
        }
         [WebMethod]
        /// <summary>
        /// 培训类型的修改
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int traintypeupt(traintype_tbModel t)
        {
            return peixunbll.traintypeupt(t);
        }
        [WebMethod]
        /// <summary>
        /// 添加人员信息
        /// </summary>
        /// <returns></returns>
        public int RenAdd(Models.Staff w)
        {
            return new BLL.RenyuanBLL().RenAdd(w);
        }
        [WebMethod]
        /// <summary>
        /// 修改人员信息
        /// </summary>
        /// <returns></returns>
        public int updateRen(Staff m)
        {
            return new BLL.RenyuanBLL().updateRen(m);
        }
        [WebMethod]

        ///查询人员信息
        public List<Staff> cha(string Staff_Name)
        {
            return new BLL.RenyuanBLL().cha(Staff_Name);
        }
        [WebMethod]
        /// <summary>
        /// 提交奖惩
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public int Jc(奖惩 m)
        {
            return new BLL.RenyuanBLL().Jc(m);
        }
        [WebMethod]
        /// <summary>
        /// 档案显示
        /// </summary>
        /// <returns></returns>
        public List<DangAn> DangAnIndex()
        {
            return new RenyuanBLL().DangAnIndex();
        }
        /// <summary>
        /// 档案详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [WebMethod]
        public DangAn FT(int id)
        {
            return new RenyuanBLL().DnagAnFT(id);
        }
        [WebMethod]
        /// <summary>
        /// 添加人员档案
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public int DangAnAdd(DangAn m)
        {
            return new RenyuanBLL().DangAnAdd(m);
        }
          [WebMethod]
        /// <summary>
        /// 删除人员档案
        /// </summary>
        /// <param name="DangAn_ID"></param>
        /// <returns></returns>
        public int DangAnDel(string id)
        {
            return new RenyuanBLL().DangAnDel(id);
        }
          [WebMethod]
          /// <summary>
          /// 几条奖惩信息未处理
          /// </summary>
          /// <returns></returns>
          public int Tiaoshu()
          {
              return new RenyuanBLL().Tiaoshu();
          }
         [WebMethod]
          /// 合同显示
          public List<Contracts> ContractsIndex()
          {
              return new RenyuanBLL().ContractsIndex();
          }
         [WebMethod]
          //查看合同详情
         public Contracts ContractsFT(int id)
         {
             return new RenyuanBLL().ContractsFT(id);
         }
         [WebMethod]
         //添加员工合同
         public int ContractsAdd(Contracts m)
         {
             return new RenyuanBLL().ContractsAdd(m);
         }
        [WebMethod]
         //奖惩审批页面
         public List<奖惩> Jcindex()
         {
             return new RenyuanBLL().Jcindex();
         }
         [WebMethod]
          //审批详情
        public 奖惩 Jcshenpi(int id)
        {
            return new RenyuanBLL().Jcshenpi(id);
        }
         [WebMethod]
         ///审批奖惩
         public int TG(int id)
         {
             return new RenyuanBLL().TG(id);
         }
         [WebMethod]
          ///审批拒绝
         public int JJ(int id)
         {
             return new RenyuanBLL().JJ(id);
         }
          [WebMethod]
        //奖惩显示
         public List<奖惩> JiangchengIndex()
         {
             return new RenyuanBLL().JiangchengIndex();
         }
    }
}
